
package com.market.service;

import java.sql.Connection;

import org.hibernate.criterion.DetachedCriteria;

import com.market.dao.GenericDao;
//import com.market.dao.IBaseDAO;
import com.market.dao.ICustomerDAO;
import com.market.dao.ILineitemDAO;
import com.market.dao.IMessageDAO;
import com.market.dao.IMsgBoardDAO;
import com.market.dao.IOrdersDAO;
import com.market.dao.IProCriDAO;
import com.market.dao.IProductDAO;
import com.market.dao.IScrollDAO;
import com.market.dao.ISubproductDAO;
import com.market.dao.ISupplierDAO;

public class BaseServiceImpl implements IBaseService
{
    private GenericDao baseDAO;

    private IScrollDAO scrollDAO;

    private IProductDAO productDAO;

    private ICustomerDAO customerDAO;

    private IMessageDAO messageDAO;

    private ISupplierDAO supplierDAO;

    private IProCriDAO proCriDAO;

    private IMsgBoardDAO msgboardDAO;

    private ISubproductDAO subproductDAO;

    private IOrdersDAO ordersDAO;

    private ILineitemDAO lineitemDAO;

    public ILineitemDAO getLineitemDAO()
    {
        return lineitemDAO;
    }

    public void setLineitemDAO(ILineitemDAO lineitemDAO)
    {
        this.lineitemDAO = lineitemDAO;
    }

    public IOrdersDAO getOrdersDAO()
    {
        return ordersDAO;
    }

    public void setOrdersDAO(IOrdersDAO ordersDAO)
    {
        this.ordersDAO = ordersDAO;
    }

    public ISubproductDAO getSubproductDAO()
    {
        return subproductDAO;
    }

    public void setSubproductDAO(ISubproductDAO subproductDAO)
    {
        this.subproductDAO = subproductDAO;
    }

    public IMsgBoardDAO getMsgboardDAO()
    {
        return msgboardDAO;
    }

    public void setMsgboardDAO(IMsgBoardDAO msgBoardDAO)
    {
        this.msgboardDAO = msgBoardDAO;
    }

    public IProCriDAO getProCriDAO()
    {
        return proCriDAO;
    }

    public void setProCriDAO(IProCriDAO proCriDAO)
    {
        this.proCriDAO = proCriDAO;
    }

    public ISupplierDAO getSupplierDAO()
    {
        return supplierDAO;
    }

    public void setSupplierDAO(ISupplierDAO supplierDAO)
    {
        this.supplierDAO = supplierDAO;
    }

    public IMessageDAO getMessageDAO()
    {
        return messageDAO;
    }

    public void setMessageDAO(IMessageDAO messageDAO)
    {
        this.messageDAO = messageDAO;
    }

    public ICustomerDAO getCustomerDAO()
    {
        return customerDAO;
    }

    public void setCustomerDAO(ICustomerDAO customerDAO)
    {
        this.customerDAO = customerDAO;
    }

    public IProductDAO getProductDAO()
    {
        return productDAO;
    }

    public void setProductDAO(IProductDAO productDAO)
    {
        this.productDAO = productDAO;
    }

    public IScrollDAO getScrollDAO()
    {
        return scrollDAO;
    }

    public void setScrollDAO(IScrollDAO scrollDAO)
    {
        this.scrollDAO = scrollDAO;
    }

    public void saveOrUpdate(Object obj)
    {
        baseDAO.saveOrUpdate(obj);
    }

    public void delete(Object obj)
    {
        baseDAO.delete(obj);
    }

    public GenericDao getBaseDAO()
    {
        return baseDAO;
    }

    public void setBaseDAO(GenericDao baseDAO)
    {
        this.baseDAO = baseDAO;
    }

    protected void deleteByDetachedCriteria(DetachedCriteria detachCri)
    {
        // TODO Auto-generated method stub
        getBaseDAO().deleteByDetachedCriteria(detachCri);
    }
    
    public Connection getConnection()
    {
        return getBaseDAO().getConnection();
    }
}
